package com.dx.controller;

import com.dx.pojo.*;
import com.dx.pojo.armor.Armor;
import com.dx.pojo.armor.ArmorInfo;
import com.dx.pojo.legend.ItemLegendDetail;
import com.dx.pojo.legend.ItemsLegend;
import com.dx.pojo.legend.Legend;
import com.dx.pojo.legend.SealsLegend;
import com.dx.pojo.weapon.Weapon;
import com.dx.pojo.weapon.WeaponInfo;
import com.dx.service.DestinyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class DestinyController {
    @Autowired
    private DestinyService destinyService;

    @RequestMapping("/getWeaponCard")
    public List<WeaponCard> getWeaponCard() throws Exception {
        List<WeaponCard> weaponCard = destinyService.getWeaponCard();
        return weaponCard;
    }
    
    @RequestMapping("/getEntries")
    public List<String> getEntries() throws Exception {
        List<String> entries = destinyService.getEntries();
        return entries;
    }

    @RequestMapping("/getWeapon")
    public List<Weapon> getWaepon(String page) throws Exception{
        List<Weapon> weaponList = destinyService.getWeapon(page);
        return weaponList;
    }

    @RequestMapping("/getLegends")
    public List<List<Legend>> getLegends() throws Exception{
        return destinyService.getLegends();
    }

    @RequestMapping("/getArmor")
    public List<Armor> getArmor(int page)throws Exception{
        return destinyService.getArmor(page);
    }

    @RequestMapping("/getNewExoticWeapons")
    public List<Weapon> getNewExoticWeapons() throws Exception{
        return destinyService.getNewExoticWeapons();
    }

    @RequestMapping("/getNewWeapons")
    public List<Weapon> getNewWeapons() throws Exception{
        return destinyService.getNewWeapons();
    }

    @RequestMapping("/getNewExoticArmor")
    public List<Armor> getNewExoticArmor() throws Exception{
        return destinyService.getNewExoticArmor();
    }

    @RequestMapping("/getNewArmor")
    public List<Armor> getNewArmor() throws Exception{
        return destinyService.getNewArmor();
    }

    @RequestMapping("/getNewItems")
    public List<Other> getNewItems(String c,String s) throws Exception{
        return destinyService.getNewItems(c,s);
    }

    @RequestMapping("/getNewExoticItems")
    public List<Other> getNewExoticItems() throws Exception{
        return destinyService.getNewExoticItems();
    }

    @RequestMapping("/getWeaponInfo")
    public WeaponInfo getWeaponInfo(String id) throws Exception {
        return destinyService.getWeaponInfo(id);
    }

    @RequestMapping("/getArmorInfo")
    public ArmorInfo getArmorInfo(String id) throws Exception {
        return destinyService.getArmorInfo(id);
    }

    @RequestMapping("/getSealsLegend")
    public List<SealsLegend> getSealsLegend(String id) throws Exception {
        return destinyService.getSealsLegend(id);
    }

    @RequestMapping("/getItemsLegend")
    public List<ItemsLegend> getItemsLegend(String id) throws Exception {
        return destinyService.getItemsLegend(id);
    }

    @RequestMapping("/getItemsLegendDetail")
    public List<ItemLegendDetail> getItemsLegendDetail(String id) throws Exception {
        return destinyService.getItemsLegendDetail(id);
    }
}
